﻿<h2>Admin Control Panel</h2>

<!--<form name="adminForm">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            Name: <input type="text" ng-model="item.Name" class="customtextbox form-control" placeholder="Item Name" />
            Description: <input type="text" ng-model="item.Description" class="customtextbox form-control" placeholder="Description" />
            Image: <input type="text" ng-model="item.Image" class="customtextbox form-control" placeholder="Image" /><hr />
            Start Time: <input type="text" ng-model="bid.StartTime" class="customtextbox form-control" placeholder="Start Time" />
            Duration: <input type="time" ng-model="bid.Duration" class="customtextbox form-control" placeholder="Duration" />
        </div>
        <div class="row">
            <div class="col-md-5 col-md-offset-2">
                <button class="btn btn-success btn-block" ng-click="addItem(item)">Submit</button>
            </div>
        </div>
    </div>
</form>-->




<div class="ch-container">
    <div class="row">

        <!-- left menu starts -->
        <div class="col-sm-2 col-lg-2">
            <div class="sidebar-nav">
                <div class="nav-canvas">
                    <div class="nav-sm nav nav-stacked">
                    </div>
                    <ul class="nav nav-pills nav-stacked main-menu">
                        <li class="nav-header">Main</li>
                        <li>
                            <a class="ajax-link" href ng-click="adminDash=true"><i class="glyphicon glyphicon-home"></i><span> Dashboard</span></a>
                        </li>
                        <li>
                            <a class="ajax-link" href ng-click="adminDash=false"><i class="glyphicon glyphicon-list-alt"></i><span> Item History</span></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <!--/span-->
        <!-- left menu ends -->
        <div id="content" class="col-lg-10 col-sm-10" ng-show="adminDash">
            <!-- content starts -->
            <div>
                <ul class="breadcrumb">
                    <li>
                        <a href="#">Home</a>
                    </li>
                    <li>
                        <a href="#">Dashboard</a>
                    </li>
                </ul>
            </div>
            <div class=" row">
                <div class="col-md-3 col-sm-3 col-xs-6">
                    <a data-toggle="tooltip" title="6 new members." class="well top-block" href="#">
                        <i class="glyphicon glyphicon-user blue"></i>
                        <div>Total Members</div>
                        <div>get numbers from scope</div>
                        <span class="notification">6</span>
                    </a>
                </div>
                <div class="col-md-3 col-sm-3 col-xs-6">
                    <a data-toggle="tooltip" title="4 new pro members." class="well top-block" href="#">
                        <i class="glyphicon glyphicon-star green"></i>
                        <div>Pro Members</div>
                        <div>228</div>
                        <span class="notification green">4</span>
                    </a>
                </div>
                <div class="col-md-3 col-sm-3 col-xs-6">
                    <a data-toggle="tooltip" title="$34 new sales." class="well top-block" href="#">
                        <i class="glyphicon glyphicon-shopping-cart yellow"></i>
                        <div>Get total amount of sales</div>
                        <div>$13320</div>
                        <span class="notification yellow">$34</span>
                    </a>
                </div>
                <div class="col-md-3 col-sm-3 col-xs-6">
                    <a data-toggle="tooltip" title="12 new messages." class="well top-block" href="#">
                        <i class="glyphicon glyphicon-envelope red"></i>
                        <div>Messages</div>
                        <div>25</div>
                        <span class="notification red">12</span>
                    </a>
                </div>
            </div>

            <div class="row">
                <div class="box col-md-4">
                    <div class="box-inner homepage-box">
                        <div class="box-header well">
                            <h2><i class="glyphicon glyphicon-th"></i> Create New Item</h2>
                        </div>
                        <div class="box-content">
                            Item Name: <input type="text" ng-model="item.Name" class="customtextbox form-control" placeholder="Item Name" style="width:100%" />
                            Item Description: <textarea ng-model="item.Description" class="customtextbox form-control" placeholder="Item Description" style="width:100%"></textarea>
                            Category: <select data-ng-model="item.Category" class="customtextbox form-control" style="width:100%; height:auto">
                                          <option value="Smartwatches">Smartwatches</option>
                                          <option value="Smartphones">Smartphones</option>
                                          <option value="Computers/Laptops">Computers/Laptops</option>
                                          <option value="Artificial Intelligence/Robots">Artificial Intelligence/Robots</option>
                                          <option value="Futuristic Technology">Futuristic Technology</option>
                                          <option value="Flying Things">Flying Things</option>
                                    </select>
                            <div id="myTabContent" class="tab-content">
                                <div class="tab-pane active" id="info">
                                    <h3>
                                        Add Images
                                        <button class="pull-right btn-sm btn-primary glyphicon-plus" ng-click="addImage()"></button>
                                    </h3>
                                    <div ng-repeat="image in images">
                                        <input type="text" ng-model="image.url" class="customtextbox form-control" placeholder="Image Url" style="width:100%" />
                                    </div>
                                    <button class="btn btn-success btn-sm pull-right" ng-click="SaveItem(item)">Save Item</button>
                                </div>
                                <div class="tab-pane" id="custom">
                                    <h3>
                                        Custom
                                        <small>small text</small>
                                    </h3>
                                    <p>Sample paragraph.</p>
                                    <p>Your custom text.</p>
                                </div>
                                <div class="tab-pane" id="messages">
                                    <h3>
                                        Messages
                                        <small>small text</small>
                                    </h3>
                                    <p>Sample paragraph.</p>
                                    <p>Your custom text.</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--/span-->
                <div class="box col-md-4">
                    <div class="box-inner  homepage-box">
                        <div class="box-header well" data-original-title="">
                            <h2><i class="glyphicon glyphicon-user"></i> Send Notice To All Users</h2>
                        </div>
                        <div class="box-content">
                            Subject Line: <input type="text" ng-model="email.Title" class="customtextbox form-control" placeholder="Subject Line" style="width:100%" />
                            Message Body: <textarea ng-model="email.Body" class="customtextbox form-control" placeholder="Message Body" style="width:100%; margin:1px;"></textarea><br />
                            <button class="btn btn-success btn-sm pull-right" ng-click="SendMessage(email)">Send Message</button>
                        </div>
                    </div>
                </div>
                <div class="box col-md-4">
                    <div class="box-inner homepage-box">
                        <div class="box-header well" data-original-title="">
                            <h2><i class="glyphicon glyphicon-list-alt"></i> User Management</h2>
                        </div>
                        <div class="box-content">
                            <h4>User List</h4>
                            
                            <table class="table">
                                <thead>
                                    <tr><td>UserName</td><td>Bids Remaining</td><td>Wallet</td></tr>
                                </thead>

                                <tr ng-repeat="user in users | filter: UserName">
                                    <td> {{user.UserName}}</td>
                                    <td>{{user.BidsRemaining}}</td>
                                    <td>{{user.Wallet}}</td>
                                </tr>
                            </table>

                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
            </div><!--/row-->
            <!-- content ends -->
        </div><!--/#content.col-md-0-->
        <div class="col-lg-10 col-sm-10" ng-hide="adminDash" style="overflow: auto; max-height:600px">
            <h1>Item History Page</h1>
            <table class="table" style="background-color:antiquewhite;color:black">
                <tr>
                    <td><strong>Item Name</strong></td>
                    <td><strong>Sold Price</strong></td>
                    <td><strong>Winning User</strong></td>
                    <th colspan="2"></th>
                </tr>
                <tr data-ng-repeat="i in allitems" class="{{i.class}}">
                    <td>{{i.Name}}</td>
                    <td>{{i.Cost}}</td>
                    <td>{{i.UserName}}</td>

                    <td class="text-center" ng-hide="{{i.IsActive}};"><button class="glyphicon glyphicon-pencil btn btn-sm btn-warning" disabled></button></td>
                    <td class="text-center" ng-show="{{i.IsActive}}" > <button class="glyphicon glyphicon-pencil btn btn-sm btn-warning" ng-click="showEdit=true" ng-hide="showEdit"></button></td>
                     
                    <td ng-show="showEdit">
                        <form name="editForm">
                            <div class="row">

                                <div class="col-xs-12 form-group">
                                    Item Name: <input ng-model="i.Name" class="customtextbox form-control" />
                                    Item Cost: <input ng-model="i.Cost" class=" custometextbox form-control" />
                                    Item Description: <input ng-model="i.Description" class=" custometextbox form-control" />
                                    <div ng-repeat="image in i.imageUrl">Item Image: <input ng-model="image" class="custometextbox form-control" /></div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-6 form-group">
                                        <button class="btn btn-success form-control" ng-click="EditItem(i); showEdit=false">Submit</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </td>

                    <td class="text-center" ng-hide="{{i.IsActive}}"><button class="glyphicon glyphicon-remove btn btn-sm btn-danger" disabled></button></td>
                    <td class="text-center" ng-show="{{i.IsActive}}"><button class="glyphicon glyphicon-remove btn btn-sm btn-danger" ng-click="DeleteItem(i)" ng-hide="showEdit"></button></td>
                </tr>
            </table>
        </div>

    </div><!--/fluid-row-->

    <hr>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h3>Settings</h3>
                </div>
                <div class="modal-body">
                    <p>Here settings can be configured...</p>
                </div>
                <div class="modal-footer">
                    <a href="#" class="btn btn-default" data-dismiss="modal">Close</a>
                    <a href="#" class="btn btn-primary" data-dismiss="modal">Save changes</a>
                </div>
            </div>
        </div>
    </div>

</div><!--/.fluid-container-->
